1 <?php
2  session_start();
3  
if(isset($_SESSION['user']))
4  {
5
6  }
7  
else{
8   echo
"<script>location.href='login.html'</script>";
9  }
10 ?>
11 <!doctype html>
12 <html>
13     <head>
14         <title>Saledetails </title>
15         <style>
16
17             body {
18   margin:
0;
19   font-family: Arial, Helvetica, sans-serif;
20   background: #
484848;
21 }
22 .topnav {
23   overflow: hidden;
24   background-color:rgba(
249, 105, 14, 1);
25   height: 70px;
26   border: 3px solid #e69500;
27 }
28
29 .topnav a {
30   
float: left;
31   color: #f2f2f2;
32   text-align: center;
33   padding: 14px 16px;
34   text-decoration: none;
35   font-size: 35px;
36   font-weight: bold;
37 }
38
39 .topnav-right {
40   
float: right;
41 }
42 table {
43     font-family: arial, sans-serif;
44     border-collapse: collapse;
45     outline:#e69500 solid 5px;
46     background: #FAFAFA;
47     width:
100%;
48     margin:5px ;
49 }
50
51 td, th {
52     border: 1px solid #dddddd;
53     text-align: left;
54     padding: 8px;
55 }
56 th{
57     background-color:rgba(
249, 105, 14, 1);
58 }
59
60
61 .custombutton{
62   margin:25px;
63   
64 }input[type=text] {
65     width:
15%;
66     padding: 12px 20px;
67     margin: 8px ;
68     background:transparent;
69     border: 2px solid red;
70 }
71     </style>
72 </head>
73 <body>
74 <div
class="topnav">
75             <a
class="active" href="home.html"><img src="ic_add_pet.png"></a>
76             <a href=
"soldproducts.php">sold products</a>
77             <div
class="topnav-right">
78               <a href=
"logout.php">logout</a>
79             </div>
80           </div>
81           <div
class="custombutton">
82 <form>
83 <button style=
" height: 50px;width: 150px;cursor:pointer;border-radius:15px;
84 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:15px;" formaction="sales.php">Back</button>
85 <button style=
" height: 50px;width: 150px;cursor:pointer;border-radius:15px;
86 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:15px;" formaction="soldpdadd.php">Add new details</button>
87 </form>
88 </div>
89 <?php
90    
91 $con = mysqli_connect(
"localhost","root","","Petshop_management");
92 if
(!$con)
93 {
94 die(
"could not connect".mysql_error());
95 }
96 $
var=mysqli_query($con,"select * from sold_products ");
97 echo
"<table border size=10>";
98 echo
"<tr>
99 <th>sd_ID</th>
100 <th>pp_id</th>
101 <th>quantity</th>
102 </tr>"
;
103 if
(mysqli_num_rows($var)>0){
104     
while($arr=mysqli_fetch_row($var))
105     { echo
"<tr>
106     <td>$arr[
0]</td>
107     <td>$arr[
1]</td>
108     <td>$arr[
2]</td>
109     </tr>"
;}
110     echo
"</table>";
111     mysqli_free_result($
var);
112 }
113
114 mysqli_close($con);
115     
116     
117 ?>
118 <form action=
"deletesoldpd.php" method="post">
119 <input type=
"text" name="t1" placeholder="Enter sales_id to delete" required>
120 <input type=
"text" name="t2" placeholder="Enter product_id number" required>
121     <input style=
"width:75px;height:44px;cursor:pointer;border-radius:15px;
122 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:15px;"type="submit" value="Delete">
123 </form>
124
125 </body>
126 </html>


Gõ tìm kiếm nhanh...